package com.particle.data.infrastructure.company.structmapping;

import com.particle.data.infrastructure.company.dos.DataCompanyIprPlantVarietyDO;
import com.particle.data.domain.company.DataCompanyIprPlantVariety;
import com.particle.data.domain.company.DataCompanyIprPlantVarietyId;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * <p>
 * 企业知识产权植物新品种 基础设施层数据实体映射转换
 * </p>
 *
 * @author yw
 * @since 2025-06-16 11:17:40
 */
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public abstract class DataCompanyIprPlantVarietyInfrastructureStructMapping {
	public static DataCompanyIprPlantVarietyInfrastructureStructMapping instance = Mappers.getMapper( DataCompanyIprPlantVarietyInfrastructureStructMapping.class );

	protected DataCompanyIprPlantVarietyId map(Long id){
		if (id == null) {
			return null;
		}
		return DataCompanyIprPlantVarietyId.of(id);
	}
	protected Long map(DataCompanyIprPlantVarietyId dataCompanyIprPlantVarietyId){
		if (dataCompanyIprPlantVarietyId == null) {
			return null;
		}
		return dataCompanyIprPlantVarietyId.getId();
	}

	/**
	 * 数据实体转领域模型
	 * MapStruct自动映射,其中枚举也会自动映射，id转换会自动使用{@link DataCompanyIprPlantVarietyInfrastructureStructMapping#map(java.lang.Long)}
	 * @param dataCompanyIprPlantVarietyDO
	 * @return
	 */
	public abstract DataCompanyIprPlantVariety dataCompanyIprPlantVarietyDOToDataCompanyIprPlantVariety(@MappingTarget DataCompanyIprPlantVariety dataCompanyIprPlantVariety,DataCompanyIprPlantVarietyDO dataCompanyIprPlantVarietyDO);

	/**
	 * 领域模型转数据实体
	 * MapStruct自动映射,其中枚举也会自动映射，id转换会自动使用{@link DataCompanyIprPlantVarietyInfrastructureStructMapping#map(DataCompanyIprPlantVarietyId)}
	 * @param dataCompanyIprPlantVariety
	 * @return
	 */
	public abstract DataCompanyIprPlantVarietyDO dataCompanyIprPlantVarietyToDataCompanyIprPlantVarietyDO(DataCompanyIprPlantVariety dataCompanyIprPlantVariety);

}
